<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <ul class="list"></ul>
    <script>
        console.log(window.document.createDocumentFragment);
        var parent = document.querySelector('.list');
        var frag = document.createDocumentFragment();
        for(var i=0;i<500000;i++){
            var li = document.createElement('li');
            var text = document.createTextNode(+i);
            li.appendChild(text);
            frag.appendChild(li);
        }

        parent.appendChild(frag);

    </script>
</body>
</html>